<include file="Public/head"/>
<link type="text/css" rel="stylesheet" href="{:get_style_cdnurl()}paimai/yunying/plugin/select2/select2.css" />
<script src="{:get_style_cdnurl()}paimai/yunying/plugin/select2/select2.js" type="text/javascript"></script>
<script src="http://img1.isou365.cn/paimai/yunying/js/city.js" type="text/javascript"></script>
<style>
    .shop_details ul li span .menHover {  background: #20ab4f;  color: #fff;  }
    .menDao a {  background: #cecece;  color: #303030;  padding: 0 10px;  text-align: center;  height: 24px;  line-height: 24px;  cursor: pointer;  }
    .negotiation h4{ position: absolute;color:#20ab4f;top:-15px;left:30px;font-size:14px;width:90px; text-align:center;display: block;height: 30px; line-height: 30px; background:#fff;}
    .negotiation span,.negotiation2 span{ display: block;float: left;height:28px; line-height: 28px;margin-right:30px;color:#333;}
    .negotiation span input{ text-align: center;height:26px; line-height: 26px;width:180px;font-size:12px;}
    .negotiation span i{ display: inline-block;padding-right:10px;}
    .negotiation em{height:50px; line-height: 50px; text-align: left;width:760px; display: block;color:#333;}
</style>
<include file="Public/common_header"/>
<div class="mian">
    <include file="Public/sidebar" menu="zsgl.zscl"/>
    <div class="mianR">
        <div class="listBox">
            <h3 class="cha">
                <if condition="$status eq 0">
                    车辆处理详情
                    <elseif condition="$status eq 1"/>
                    已重拍详情
                    <elseif condition="$status eq 2"/>
                    已退车详情
                    <elseif condition="$status eq 3"/>
                    交易成功
                    <elseif condition="$status eq 4"/>
                    其他渠道成交
                </if>
            </h3>
            <div class="car_info">
                <div class="car_no"><span style="font-size:14px;">车辆编号：<b>{$detail.sno}</b></span></div>
                <table border="1" width="100%">
                    <tbody>
                    <tr>
                        <td colspan="4" style="background-color:#c1c1c1;font-size:14px;"><span>车主信息</span></td>
                    </tr>
                    <tr>
                        <td width="11%" style="color:#898b8a;">车主类型</td>
                        <td width="39%">{$detail.owner_type_name}</td>
                        <if condition="$detail.owner_type eq 1">
                            <td width="11%" style="color:#898b8a;">车主姓名</td>
                            <td width="39%">{$detail.seller_name}</td>
                            <else />
                            <td width="11%" style="color:#898b8a;">公司名称</td>
                            <td width="39%">{$detail.seller_name}</td>
                        </if>
                    </tr>
                    <tr>
                        <if condition="$detail.owner_type eq 1">
                            <td width="11%" style="color:#898b8a;">联系电话</td>
                            <td colspan="3">{$detail.seller_phone}</td>
                            <else />
                            <td width="11%" style="color:#898b8a;">联系人姓名</td>
                            <td width="39%">{$detail.contact_person}</td>
                            <td width="11%" style="color:#898b8a;">联系电话</td>
                            <td width="39%">{$detail.seller_phone}</td>
                        </if>
                    </tr>
                    </tbody>
                </table>

                <table border="1" width="100%" style="margin-top:10px;">
                    <tbody>
                    <tr>
                        <td colspan="4" style="background-color:#c1c1c1;font-size:14px;"><span>评估师信息</span></td>
                    </tr>
                    <tr>
                        <td width="11%" style="color:#898b8a;">评估师姓名</td>
                        <td width="39%">{$detail.checker_name}</td>
                        <td width="11%" style="color:#898b8a;">评估师电话</td>
                        <td width="39%">{$detail.checker_phone}</td>
                    </tr>
                    </tbody>
                </table>

                <table border="1" width="100%" style="margin-top:10px;">
                    <tbody>
                    <tr>
                        <td colspan="4" style="background-color:#c1c1c1;font-size:14px;">
                            <span>车辆信息
                                <if condition="$detail.status eq 1">
                                （已重拍 {$detail.reau_times} 次）
                                </if>
                            </span>
                            <span style="float:right;padding-right: 10%;">
                                <a style="color:#20ab4f;font-weight:bolder;text-decoration: underline" href="{:U('Car/report',['car_id'=>$detail['car_id']])}" target="_blank">检测报告</a>
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td width="11%" style="color:#898b8a;">车型</td>
                        <td width="39%">{$detail.model}</td>
                        <td width="11%" style="color:#898b8a;">排放标准</td>
                        <td width="39%">{$detail.emission}</td>
                    </tr>
                    <tr>
                        <td style="color:#898b8a;">初登日期</td>
                        <td>{$detail.first_reg_date}</td>
                        <td style="color:#898b8a;">颜色</td>
                        <td>{$detail.car_color}</td>
                    </tr>
                    <tr>
                        <td style="color:#898b8a;">表显里程</td>
                        <td>{$detail.pointer_mileage}万公里</td>
                        <td style="color:#898b8a;">车况级别</td>
                        <td>{$detail.composite_state}{$detail.accident_level}</td>
                    </tr>
                    <tr>
                        <td style="color:#898b8a;">车辆注册地</td>
                        <td>{$detail.first_reg_city}</td>
                        <td style="color:#898b8a;">车架号</td>
                        <td>{$detail.vin}</td>
                    </tr>
                    <tr>
                        <td style="color:#898b8a;">过户限制</td>
                        <td>{$detail.transfer_limit_str}</td>
                        <td style="color:#898b8a;">车牌号</td>
                        <td>{$detail.plate_prefix}{$detail.plate_suffix}</td>
                    </tr>
                    <tr>
                        <td style="color:#898b8a;">渠道来源</td>
                        <td>
                            <if condition="$detail.comefrom neq ''">
                                <?php if(empty($detail['comefrom_url'])):?>
                                {$detail.comefrom}
                                <?php else: ?>
                                <a href="{$detail.comefrom_url}" target="_blank" rel="noreferrer">{$detail.comefrom}</a>
                                <?php endif;?>
                                <else/>
                                未知
                            </if>
                        </td>
                        <td style="color:#898b8a;">所在地</td>
                        <td>{$detail.location_area}</td>
                    </tr>
                    </tbody>
                </table>

                <if condition="$detail.status eq 1 OR $detail.status eq 2 OR $detail.status eq 3 OR $detail.status eq 4">
                    <table border="1" width="100%" style="margin-top:10px;">
                        <tbody>
                        <tr>
                            <td colspan="4" style="background-color:#c1c1c1;font-size:14px;"><span>自收信息</span></td>
                        </tr>
                        <tr>
                            <td width="11%" style="color:#898b8a;">成交价格</td>
                            <td width="39%">{$detail['self_receive_price']}元</td>
                            <td width="11%" style="color:#898b8a;">成交时间</td>
                            <td width="39%">{$detail['self_success_trade_time']}</td>
                        </tr>
                        <if condition="$detail.status eq 1">
                            <tr>
                                <td width="11%" style="color:#898b8a;">自收人</td>
                                <td colspan="3">{$detail['self_dealer_name']}</td>
                            </tr>
                            <!--<tr>
                                <td width="11%" style="color:#898b8a;">原保留价</td>
                                <td width="39%">{:format_money($detail['reserve_price'])}元</td>
                                <td width="11%" style="color:#898b8a;">现保留价</td>
                                <td width="39%">{:format_money($detail['current_reserve_price'])}元</td>
                            </tr>
                            <tr>
                                <td width="11%" style="color:#898b8a;">自收人</td>
                                <td colspan="3">{$detail['self_dealer_name']}</td>
                            </tr>-->
                        <else />
                            <tr>
                                <td width="11%" style="color:#898b8a;">自收保留价</td>
                                <td width="39%">{:format_money($detail['reserve_price'])}元</td>
                                <td width="11%" style="color:#898b8a;">自收人</td>
                                <td width="39%">{$detail['self_dealer_name']}</td>
                            </tr>
                        </if>
                        </tbody>
                    </table>
                </if>

                <if condition="$detail.status eq 1"> <!-- 已重拍 -->
                    <table border="1" width="100%" style="margin-top:10px;">
                        <tbody>
                            <tr>
                                <td colspan="4" style="background-color:#c1c1c1;font-size:14px;"><span>重拍信息</span></td>
                            </tr>
                            <tr>
                                <td width="11%" style="color:#898b8a;">报告处理方式</td>
                                <td width="39%">
                                    <if condition="$detail.report_type eq 1">
                                        重新检测
                                    <else/>
                                        原报告
                                    </if>
                                <td width="11%" style="color:#898b8a;">重拍单号</td>
                                <td width="39%">{$detail['order_no']}</td>
                            </tr>
                            <tr>
                                <td width="11%" style="color:#898b8a;">原保留价</td>
                                <td width="39%">{:format_money($detail['reserve_price'])}元</td>
                                <td width="11%" style="color:#898b8a;">现保留价</td>
                                <td width="39%">{:format_money($detail['current_reserve_price'])}元</td>
                            </tr>
                            <tr>
                                <td>重拍备注</td>
                                <td colspan="3">{$detail.remark}</td>
                            </tr>
                        </tbody>
                    </table>
                </if>

                <if condition="$detail.status eq 2"> <!-- 已退车 -->
                    <table border="1" width="100%" style="margin-top:10px;">
                        <tbody>
                        <tr>
                            <td colspan="4" style="background-color:#c1c1c1;font-size:14px;"><span>退车信息</span></td>
                        </tr>
                        <if condition="empty($detail['back_reason'])"> <!-- 如果退车原因为空，表示是旧数据 -->
                            <tr>
                                <td width="11%" style="color:#898b8a;">退车原因</td>
                                <td width="39%">
                                    <?php if ($detail['compensate_type'] == 1): ?>
                                    <?php if ($detail['back_method'] == 1): ?>
                                    检测失误
                                    <?php else: ?>
                                    车主原因
                                    <?php endif ?>
                                    <?php else: ?>
                                    车商违约
                                    <?php endif ?>
                                </td>
                                <?php if ($detail['compensate_type'] == 1): ?>
                                <?php if ($detail['back_method'] == 1): ?>
                                <td width="11%" style="color:#898b8a;">补偿金额</td>
                                <?php else: ?>
                                <td width="11%" style="color:#898b8a;">扣除金额</td>
                                <?php endif ?>
                                <?php else: ?>
                                <td width="11%" style="color:#898b8a;">补偿金额</td>
                                <?php endif ?>
                                <td width="39%">{$detail.compensate}</td>
                            </tr>
                            <tr>
                                <td width="11%" style="color:#898b8a;">退车备注</td>
                                <td colspan="3">{$detail.remark}</td>
                            </tr>
                        <else/>

                            <tr>
                                <td width="11%" style="color:#898b8a;">类型</td>
                                <td width="39%">
                                    收付类型
                                </td>
                                <td>金额</td>
                                <td>备注</td>
                            </tr>
                            <tr>
                                <td width="11%" style="color:#898b8a;">车款</td>
                                <td width="39%">已付</td>
                                <td width="11%" style="color:#898b8a;">{$first_payment_data.amount}元</td>
                                <td width="39%">{$detail.remark_amount_of_car}</td>
                            </tr>
                            <!--判断付款还是赔款-->
                            <?php if($detail['back_reason'] == 1):?>
                                <tr>
                                    <td width="11%" style="color:#898b8a;">赔付车主</td>
                                    <td width="39%">付款</td>
                                    <td width="11%" style="color:#898b8a;">{$detail.compensate}元</td>
                                    <td width="39%">{$detail.remark_payment}</td>
                                </tr>
                            <?php elseif($detail['back_reason'] == 2):?>
                                <tr>
                                    <td width="11%" style="color:#898b8a;">车主违约金</td>
                                    <td width="39%">收款</td>
                                    <td width="11%" style="color:#898b8a;">{$detail.compensate}元</td>
                                    <td width="39%">{$detail.remark_payment}</td>
                                </tr>
                            <?php endif;?>
                       <!-- </table>-->

                           <!-- <tr>
                                <td width="11%" style="color:#898b8a;">退车原因</td>
                                <td width="39%">
                                    <?php if($detail['back_reason'] == 1):?>
                                        平台失误
                                    <?php elseif($detail['back_reason'] == 2):?>
                                        卖方违约
                                    <?php else:?>
                                        平退
                                    <?php endif?>
                                </td>
                                <?php if (!empty($detail['collection_id'])): ?>
                                    <td width="11%" style="color:#898b8a;">扣除金额</td>
                                <?php elseif (!empty($detail['payment_id'])): ?>
                                    <td width="11%" style="color:#898b8a;">补偿金额</td>
                                <?php else:?>
                                    <td width="11%" style="color:#898b8a;">金额</td>
                                <?php endif;?>
                                <td width="39%">{$detail.compensate}</td>
                            </tr>-->
                           <!-- <tr>
                                <td width="11%" style="color:#898b8a;">退车备注</td>
                                <td colspan="3">{$detail.remark_payment}</td>
                            </tr>-->
                      </if>

                    </table>

                    <div style="font-size: 16px;text-align: right; height: 42px;line-height: 42px;margin-bottom: -10px;color: #303030;padding-right: 10px;">
                        <?php if($detail['back_reason'] == 1):?>
                        <?php $result = $first_payment_data['amount'] - $detail['compensate'];?>
                        <?php if($result > 0):?>
                        应收车款：<span><?php echo $result;?>元</span>
                        <?php else:?>
                        应付车款：<span><?php echo $detail['compensate'] - $first_payment_data['amount'];?>元</span>
                        <?php endif;?>
                        <?php endif;?>
                        <if condition="$detail.back_reason eq 2">
                            应收车款：<span><?php echo $first_payment_data['amount'] + $detail['compensate'];?>元</span>
                            <elseif condition="$detail.back_reason eq 3"/>
                            应收车款：<span><?php echo $first_payment_data['amount'];?>元</span>
                        </if>
                    </div>
                    <table border="1" width="100%" style="margin-top:10px;">
                        <tr>
                            <td colspan="4" style="background-color:#c1c1c1;font-size:14px;"><span>备注信息</span></td>
                        </tr>
                        <tr>
                            <td width="10%">退车备注</td>
                            <td colspan="3">{$detail.remark}</td>
                        </tr>
                    </table>
                </if>

                <if condition="$detail.status egt 3"> <!-- 等于3 其他渠道成交-->
                    <table border="1" width="100%" style="margin-top:10px;">
                        <tbody>
                        <tr>
                            <td colspan="4" style="background-color:#c1c1c1;font-size:14px;"><span>成交车商信息</span></td>
                        </tr>
                        <tr>
                            <td width="11%" style="color:#898b8a;">车商联系人</td>
                            <td width="39%">{$detail.dealer_contact_person}</td>
                            <td width="11%" style="color:#898b8a;">联系人电话</td>
                            <td width="39%">{$detail.dealer_contact_mobile}</td>
                        </tr>
                        <tr>
                           <!-- <if condition="$detail.status eq 4">
                                <td width="11%" style="color:#898b8a;">车商收购价</td>
                                <td width="39%">{:format_money($detail['trade_price'])} 元</td>
                                <td width="11%" style="color:#898b8a;">提车人</td>
                                <td width="39%">{$detail.take_car_man}</td>
                            <else />
                                <td width="11%" style="color:#898b8a;">提车人</td>
                                <td colspan="3">{$detail.take_car_man}</td>
                            </if>-->
                            <td width="11%" style="color:#898b8a;">提车人</td>
                            <td colspan="3">{$detail.take_car_man}</td>
                        </tr>
                        </tbody>
                    </table>

                    <if condition="$detail.status eq 4 "> <!-- 其他渠道成交 -->
                        <table border="1" width="100%" style="margin-top:10px;">
                            <tbody>
                            <tr>
                                <td colspan="4" style="background-color:#c1c1c1;font-size:14px;"><span>交易信息</span></td>
                            </tr>
                            <tr>
                                <td width="11%">成交价格</td>
                                <td width="39%">{$detail.trade_price}元</td>
                                <td width="11%">成交时间</td>
                                <td width="39%">{$detail.dealtime}</td>
                            </tr>
                            <tr>
                                <td width="11%">交付服务费</td>
                                <td width="39%">{$detail.transfer_fee}元</td>
                                <td width="11%">收款单号</td>
                                <td width="39%"><?php echo $collection_payment_data['collectionData']['collection_no'];?></td>
                            </tr>
                            <tr>
                                <td width="11%">应收款</td>
                                <td colspan="3" width="89%"><?php echo $detail['trade_price'] + $detail['transfer_fee']; ?>元</td>
                            </tr>
                            </tbody>
                        </table>
                    </if>

                    <if condition="$detail.status eq 3"> <!-- 状态等于3时，表示是交易成功的 -->
                        <table border="1" width="100%" style="margin-top:10px;">
                            <tbody>
                                <tr>
                                    <td colspan="4" style="background-color:#c1c1c1;font-size:14px;"><span>交易信息</span></td>
                                </tr>
                                <tr>
                                    <td width="11%">拍卖最高价</td>
                                    <td width="39%">{$detail.bidding_best_price}元</td>
                                    <td width="11%">成交时间</td>
                                    <td width="39%">{$detail.dealtime}</td>
                                </tr>
                                <tr>
                                    <td width="11%">应收车款</td>
                                    <td width="39%">{$detail.final_price}元</td>
                                    <td width="11%">收款单号</td>
                                    <td width="39%"><?php echo $collection_payment_data['collectionData']['collection_no'];?></td>
                                </tr>
                            </tbody>
                        </table>
                    </if>
                </if>

               <!-- <if condition="$detail.car_source eq 1">
                    <table border="1" width="100%" style="margin-top:10px;">
                        <tbody>
                        <tr>
                            <td colspan="4" style="background-color:#c1c1c1;font-size:14px;">
                                <span>复检信息</span>
                            </td>
                        </tr>
                        <tr>
                            <td width="11%" style="color:#898b8a;">手续复检人</td>
                            <td width="39%">{$detail.procedure_checker}</td>
                            <td width="11%" style="color:#898b8a;">车况复检人</td>
                            <td width="39%">{$detail.condition_checker}</td>
                        </tr>
                        <tr>
                            <td style="color:#898b8a;">复检时间</td>
                            <td colspan="4">{$detail.recheck_time}</td>
                        </tr>
                        <tr>
                            <td style="color:#898b8a;">车况描述</td>
                            <td colspan="4">{$detail.recheck_remark}</td>
                        </tr>
                        </tbody>
                    </table>
                </if>-->

                <!--<if condition="$detail.status eq 3">
                    <div class="negotiation negotiation1">
                        <h4>结算信息</h4>
                        <em>自收成交价（{$detail.self_receive_price}元）</em>
                        <em>车商合手价（{$detail.dealer_price}元）= 拍卖最高价（{$detail.bidding_best_price}元）+ 交易服务费（{$detail.commision}元）+  交付服务费（{$detail.transfer_fee}元）</em>
                    </div>
                </if>-->


                <if condition="$detail.status neq 2 && $detail.status neq 3 && $detail.status neq 1">
                    <table border="1" width="100%" style="margin-top:10px;">
                        <tbody>
                        <tr>
                            <td colspan="4" style="background-color:#c1c1c1;font-size:14px;"><span>备注信息</span></td>
                        </tr>
                        <tr>
                            <td width="11%" style="color:#898b8a;">
                                <if condition="$detail.status eq 1">重拍<elseif condition="$detail.status eq 2" />退车<elseif condition="$detail.status eq 4"/>其它渠道成交</if>备注
                            </td>
                            <td width="89%">
                                {$detail.remark}
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </if>
            </div>
        </div>
        <div class="yongBtn1">
            <input type="button" onclick="window.close();" class="quxiao" value="关闭">
        </div>

    </div>
    <div class="clear"></div>
</div>
<include file="Public/foot" />